Switch database inside psql? - Mailing list pgsql-general

From lynch@lscorp.com (Richard Lynch)
Subject Switch database inside psql?
Date
Msg-id v02140b77b1efa8a7d563@[207.152.64.133]
Whole thread Raw
Responses Re: [GENERAL] Switch database inside psql?
List pgsql-general
I'd like to have a single file.sql that will create the same database and
some tables on several different systems.  Is it possible to 'switch' to a
different database after one does the create database?  So that tables
created would go in the new database and not template1?  Or does this
already happen and is just not documented?...  I'd be guessing a big no on
the latter, since the psql prompt still says 'template1' after I create a
database...

I get an error message when I try createdb from the command line, but once
I've done psql -u, I can do it, so I guess if I had to do this from some
sort of Perl/sed/awk/??? script (none of which I could write anyway), I'd
need to know how to convince createdb that I *am* a valid database-creator,
by golly.

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com



pgsql-general by date:

Previous
From: "Jeff Hoffmann"
Date:
Subject: help with creating an opclass for a new data type
Next
From: "John Smith"
Date:
Subject: help with Pg.pm is needed